@extends('admin.layout')
@section('title',$title)
@section('content')
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                分类管理
                <small>分类管理</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>后台首页</a></li>
                <li><a href="#">分类管理</a></li>
                <li class="active">分类列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                @if(session('success'))
                    <div class="alert alert-danger">
                        {{session('success')}}
                    </div>
                @endif
                @if(session('info'))
                    <div class="alert alert-danger">
                        {{session('info')}}
                    </div>
                @endif
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">分类列表</h3>
                        </div><!-- /.box-header -->
                        <div class="box-body">
                        
                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>分类名称</th>
                                    <th>父类名称</th>      
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $v)
                                <tr>
                                    <td>{{$v -> id}}</td>
                                    <td>{{$v -> name}}</td>
                                    <td>{{$v -> p_name}}</td>
                                    <td>
                                        @if($v -> status ==1)
                                            启用
                                        @else
                                            禁用
                                        @endif
                                    </td>
                                    <td><a href="/admin/cate/edit/{{$v->id}}">编辑</a> <a href="/admin/cate/delete/{{$v->id}}">删除</a></td>
                                </tr>
                                @endforeach
                                </tbody>
                            </table>
                            {!! $data->render() !!}
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
@endsection